From 9964f870b1e9599ccd6091c3869ad14ca030ff98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 1 Apr 2012 15:03:10 +0100 Subject: [PATCH] extensions/fast-float: reduce precision Reduce sizes of lookup tables by an order of magnitude, doubling the run-time performance. --- extensions/fast-float.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/fast-float.c b/extensions/fast-float.c index 2d02931..77ca633 100644 --- a/extensions/fast-float.c +++ b/extensions/fast-float.c @@ -199,6 +199,11 @@ babl_lookup_new (BablLookupFunction function, ((positive_max-positive_min)+ (negative_max-negative_min)), 1); + printf ("%i\n", + sizeof (BablLookup) + sizeof (float) * + ((positive_max-positive_min)+ + (negative_max-negative_min))); + lookup->positive_min = positive_min; lookup->positive_max = positive_max; lookup->negative_min = negative_min; @@ -438,8 +443,8 @@ init (void) float f; float a; - fast_pow = babl_lookup_new (core_lookup, NULL, 0.0, 1.0, 0.00001); - fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0, 1.0, 0.00001); + fast_pow = babl_lookup_new (core_lookup, NULL, 0.0, 1.0, 0.0001); + fast_rpow = babl_lookup_new (core_rlookup, NULL, 0.0, 1.0, 0.0001); for (f = 0.0; f < 1.0; f+= 0.000001) { -- 2.30.2